package com.core.entity;

import java.awt.geom.Point2D;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.LazyCollection;
import org.hibernate.annotations.LazyCollectionOption;

@Entity
@Table(name = "t_sekolah")
public class Sekolah extends DomainObject implements Serializable {

	public static String TK = "TK";
	public static String SD = "SD";
	public static String SMP = "SMP";
	public static String SMA = "SMA";

	private static final long serialVersionUID = 355662427729334936L;

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	@Column
	private String tingkatan;
	@Column
	private String nss;
	@Column
	private String npsn;
	@Column
	private String nama;
	@Column
	private String alamat;
	@Column
	private Character akreditasi;
	@Column
	private String latitude;
	@Column
	private String longitude;
	@Column(name = "no_telp")
	private String noTelp;
	@ManyToOne
	@JoinColumn(name = "kecamatan_id")
	private Kecamatan kecamatan;
	@Column(name = "uang_spp")
	private BigDecimal uangSpp;
	@Column(name = "uang_gedung")
	private BigDecimal uangGedung;
	private String website;
	@Column(name = "siswa_sekarang")
	private Integer siswaSekarang;
	@Column(name = "siswi_sekarang")
	private Integer siswiSekarang;
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "sekolah")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<Kelulusan> kelulusan = new ArrayList<Kelulusan>();
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "sekolah")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<FasilitasSekolah> fasilitasSekolah = new ArrayList<FasilitasSekolah>();
	@OneToMany(cascade = CascadeType.ALL, mappedBy = "sekolah")
	@LazyCollection(LazyCollectionOption.FALSE)
	private List<PrestasiSekolah> prestasiSekolahs = new ArrayList<PrestasiSekolah>();
	private String metodePembelajaran;

	public List<Kelulusan> getKelulusan() {
		return kelulusan;
	}

	public void setKelulusan(List<Kelulusan> kelulusan) {
		this.kelulusan = kelulusan;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTingkatan() {
		return tingkatan;
	}

	public void setTingkatan(String tingkatan) {
		this.tingkatan = tingkatan;
	}

	public String getNss() {
		return nss;
	}

	public void setNss(String nss) {
		this.nss = nss;
	}

	public String getNpsn() {
		return npsn;
	}

	public void setNpsn(String npsn) {
		this.npsn = npsn;
	}

	public String getNama() {
		return nama;
	}

	public void setNama(String nama) {
		this.nama = nama;
	}

	public String getAlamat() {
		return alamat;
	}

	public void setAlamat(String alamat) {
		this.alamat = alamat;
	}

	public Character getAkreditasi() {
		return akreditasi;
	}

	public void setAkreditasi(Character akreditasi) {
		this.akreditasi = akreditasi;
	}

	public String getLatitude() {
		return latitude;
	}

	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}

	public String getLongitude() {
		return longitude;
	}

	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}

	public String getNoTelp() {
		return noTelp;
	}

	public void setNoTelp(String noTelp) {
		this.noTelp = noTelp;
	}

	public Kecamatan getKecamatan() {
		return kecamatan;
	}

	public void setKecamatan(Kecamatan kecamatan) {
		this.kecamatan = kecamatan;
	}

	public BigDecimal getUangSpp() {
		return uangSpp;
	}

	public void setUangSpp(BigDecimal uangSpp) {
		this.uangSpp = uangSpp;
	}

	public BigDecimal getUangGedung() {
		return uangGedung;
	}

	public void setUangGedung(BigDecimal uangGedung) {
		this.uangGedung = uangGedung;
	}

	public String getWebsite() {
		return website;
	}

	public void setWebsite(String website) {
		this.website = website;
	}

	public Integer getSiswaSekarang() {
		return siswaSekarang;
	}

	public void setSiswaSekarang(Integer siswaSekarang) {
		this.siswaSekarang = siswaSekarang;
	}

	public Integer getSiswiSekarang() {
		return siswiSekarang;
	}

	public void setSiswiSekarang(Integer siswiSekarang) {
		this.siswiSekarang = siswiSekarang;
	}

	public List<FasilitasSekolah> getFasilitasSekolah() {
		return fasilitasSekolah;
	}

	public void setFasilitasSekolah(List<FasilitasSekolah> fasilitasSekolah) {
		this.fasilitasSekolah = fasilitasSekolah;
	}

	public List<PrestasiSekolah> getPrestasiSekolahs() {
		return prestasiSekolahs;
	}

	public void setPrestasiSekolahs(List<PrestasiSekolah> prestasiSekolahs) {
		this.prestasiSekolahs = prestasiSekolahs;
	}

	public String getMetodePembelajaran() {
		return metodePembelajaran;
	}

	public void setMetodePembelajaran(String metodePembelajaran) {
		this.metodePembelajaran = metodePembelajaran;
	}

	public Point2D.Double getPoint() {
		return new Point2D.Double(new Double(this.getLongitude()), new Double(
				this.getLatitude()));
	}

}
